﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

// 角色移动所带的目的性(到达目标后要做什么)
public class Purpose
{
    public Vector3 Target;
    public float StopDis;
    public Action OnReachTarget;

    // 每帧做一些事情
    public virtual void Loop()
    {

    }
}

// 带目的的追踪
public class TracePurpose : Purpose
{
    public Creature TraceTarget;

    public Action<Vector3> TraceLoopCallback;

    // 每帧做一些事情
    public override void Loop()
    {
        if (TraceLoopCallback != null)
        {
            TraceLoopCallback(TraceTarget.Position);
        }
    }
}
